
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
import django.contrib.auth.models  

from paniersApp.models import User, Participant, Group, TypePanier, Jour, Distribution

class UserInline(admin.StackedInline):
    model = User
    can_delete = False
    verbose_name_plural = 'users'

class ParticipantInline(admin.StackedInline):
    model = Participant
    can_delete = False
    verbose_name_plural = 'participants'

# Define a new User admin
class UserAdmin(UserAdmin):
    inlines = (UserInline, )

# Re-register UserAdmin
admin.site.unregister(django.contrib.auth.models.User)
admin.site.register(django.contrib.auth.models.User, UserAdmin)

for table in (Participant, Group, TypePanier, Jour, Distribution):
    admin.site.register(table)

